package com.share.demo.spring;

import com.share.demo.event.MsgEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;

/**
 * author:caifan
 * date:2019/11/29
 */
@Component
@EnableAsync
public class MsgEventListener {

    @EventListener
    @Async
    public void userEvent(MsgEvent event) {
        event.getUserMsg();
    }

}
